package com.ufo.threads;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

public class AsyncTaskWithLimitQueue {
    public static void main(String[] args) {
        startTask();
    }
    public static void startTask(){
        ExecutorService pool = new ThreadPoolExecutor(
            8,
            24,
            100L, TimeUnit.SECONDS,
            new LinkedBlockingQueue<Runnable>(100),
            new ThreadPoolExecutor.CallerRunsPolicy());
    }
}
